﻿<%@ Page Language="C#" MasterPageFile="MasterPage4.master" AutoEventWireup="true"
    EnableEventValidation="true" CodeFile="OpenCourse.aspx.cs" Inherits="Theme_index_OpenCourse"
    Title="PowerCreator Learning Management System" %>
    
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<LINK rel=stylesheet type=text/css href="css/study.css" rev=stylesheet media=all>
<SCRIPT language=javascript src="js/effect.js"></SCRIPT>
    <script language="javascript">
		        function UnShow()
                    {
                        document.getElementById("Comment").style.display="none";
                        document.getElementById("table_Content").style.display="none";
                    }
                     function Show()
                    {
                       document.getElementById("Comment").style.display="";
                       document.getElementById("table_Content").style.display="";
                    }
                    function findFrame(win)
                    {
                        var frmname;
                        if(win.MediaPlayer!=null)
                        {
                          return win;
                        }
                        else
                        {
                            frmname=win.name;
                            if (frmname!="LeftupFrame")
                            {
                                if(win.frames.length>0)
                                {
                                   for (i=0;i<win.frames.length;i++)
                                   {
                                       if(win.frames[i]!=null)
                                       {
                                          if(win.frames[i].name=="LeftupFrame")
                                          {
                                             win=win.frames[i];
                                             return win;
                                          }
                                          else
                                          {
                                             if (win.frames[i].frames.length>0)
                                             {
                                                 return findFrame(win.frames[i]); 
                                             }
                                             else
                                             {
                                                return window.parent.MainFrame;
                                             }
                                                  
                                          }
                                       }
                                   }
                                }
                            }
                            else
                            {
                               return win;           
                            }
                        }
                    }
                    function vaild(){
               var TimePosition =  0;
				var flag=true;
				var rand=Math.random();
				var filter=window.document.getElementById("txt_content").value;
				
				if(filter.length<1)
				{
				    alert("<%=config.GetLanagerValueByKey("theme_Comment_AddComment_Msg1", PowerCreator.LMS.Language.LanagetItemType.Page)%>");
				    return false;
				}
				if(filter.length>4000)
				{
				    alert("<%=config.GetLanagerValueByKey("theme_Comment_AddComment_Msg2", PowerCreator.LMS.Language.LanagetItemType.Page)%>");
				    return false;
				}
				$.ajax({
						type: "get",
						dataType: "text",
						url: "AddCommentNew.aspx",
						data: "filter="+escape(filter)+"&CourseID=<%=courseID %>&ClassID=<%=classID %>&position="+TimePosition,
						async: false,
						success: function(msg){
							if(msg==0){
								alert("<%=config.GetLanagerValueByKey("Msg_ManagerQuestion_WorkNo", PowerCreator.LMS.Language.LanagetItemType.Page)%>");
								
							}
							else{
								alert("<%=config.GetLanagerValueByKey("Msg_ManagerQuestion_WorkOK", PowerCreator.LMS.Language.LanagetItemType.Page)%>");
								flag=true;
								window.document.getElementById("txt_content").value=""
							}
						}
					});
					window.R_Evaluation.location.reload();
					vObj.MediaPlayer.Controls.Play();
				return flag;
			}
			//写入cookie的方法,保存的时间是24小时
			function writeCookie(name,value,hourse)
            {
	            var expire ="";
	            if(hourse!=null)
	            {
		            expire = new Date((new Date()).getTime()+hourse*3600000);
		            expire = ";expires="+expire.toGMTString();
	            }
	            document.cookie=name+"="+escape(value)+expire;
            	
            }
            //读取Cookie的方法
            function readCookie(name)
            {
	            var cookieValue="";
	            var search=name + "=";
	            if(document.cookie.length>0)
	            {
		            offset=document.cookie.indexOf(search);
		            if(offset !=-1)
		            {
			            offset+=search.length;
			            end=document.cookie.indexOf(";",offset);
			            if(end==-1)end=document.cookie.length;
			            cookieValue=unescape(document.cookie.substring(offset,end));
		            }
	            }
	            return cookieValue;
            }
			//此处是为了取得竞业达所提供的时间
	//function getMsg(cTime){
		//alert("aaaaa");
            //alert("aaaaa"+time);
            //var jydStr=parms +"&time="+time;
            //writeCookie("jydTime",time,24);
            //alert(readCookie("jydTime"));
            //}
    </script>

    <table cellspacing="0" cellpadding="0" width="1002" align="center" border="0" style="height: 109px;">
        <tr>
            <td background="images/111B.gif" style="font-size: 32; color: Purple;">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><asp:Label ID="lbl_CourseName"
                    runat="server"></asp:Label></strong>
            </td>
        </tr>
    </table>
    <div class="content">
    <table cellspacing="0" cellpadding="0" width="1002" align="center" border="0">  <%-- style="background-color: #B4B4B4; "    style="height: 420px;"--%>
        <tr>
            <td style="vertical-align: top;">
                <table border="0" width="160px;" style="padding: inherit; border: thin solid #FF9933;">
                    <tr>
                        <td style=" width: 118px; height:30" background="ganbu2/nav_bg.gif">
                        &nbsp;&nbsp;<img src="../../images/set001.JPG" />
                            <strong>课程目录</strong>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 118px; height:25; background-color: #FFCC66;">
                            &nbsp;&nbsp;<img src="../../images/infoA.JPG" />&nbsp;&nbsp;
                           <a href="ShowCourseDecription.aspx?cid=<%=courseID %>" target="MainFrame">课程简介</a> 
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 118px; height:25; background-color: #FFCC66;">
                        &nbsp;&nbsp;<img src="../../images/infoA.JPG" />&nbsp;&nbsp;
                            <a href="ShowCourseDecription.aspx?tid=<%=teacherid %>" target="MainFrame">教师简介</a>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 118px; height:25; background-color: #FFCC66;">
                        &nbsp;&nbsp;<img src="../../images/infoA.JPG" />&nbsp;&nbsp;
                            学习内容
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 118px">
                            <asp:Repeater ID="rptResourceType_01" runat="server">
                                <ItemTemplate>
                                    <ul>
                                        <li><a title="<%#Eval("RestpName") %>" href="ShowCourseResource.aspx?tid=<%#Eval("RestpID") %>&cid=<%=courseID %>&classid=<%=classID %>"
                                            target="MainFrame" onclick="UnShow()">
                                            &nbsp;&nbsp;&nbsp;*&nbsp;<%#Eval("RestpName") %></a></li>
                                    </ul>
                                </ItemTemplate>
                            </asp:Repeater>
                        </td>
                    </tr>
                </table>
            </td>
            <td >   <%--style="background-color: #B4B4B4; "--%>
                <table width="650" style="height:410px;" style="padding: inherit; border: thin solid #FF9933;">
                    <tr>
                        <td style="height: 40px; vertical-align: top;">
                            <%--资源类别导航--%>
                            <table >  <%-- style="background-color: #B4B4B4; color:White;"--%>
                                <tr>
                                    <%--<asp:Repeater ID="rptResourceType_02" runat="server">
                                        <ItemTemplate>
                                            <td style=" height:30" background="ganbu2/nav_bg.gif">
                                            <strong>
                                                <a title="<%#Eval("RestpName") %>" href="ShowCourseResource.aspx?tid=<%#Eval("RestpID") %>&cid=<%=courseID %>&classid=<%=classID %>"
                                                    target="MainFrame" onclick="UnShow()">
                                                    <%#Eval("RestpName") %></a></li>
                                              </strong>
                                            </td>
                                        </ItemTemplate>
                                    </asp:Repeater>--%>
                                    <td style="height: 30"  background="ganbu2/nav_bg.gif">
                                    <strong>
                                        <a href="NoteOfLearner.aspx?CourseID=<%=courseID %>&ClassID=<%=classID %>" target="MainFrame"
                                            onclick="UnShow()">课程笔记</a>
                                     </strong>
                                    </td>
                                    <td style="height: 30"  background="ganbu2/nav_bg.gif">
                                    <strong>
                                        <a href="NoteOfSingleCourse.aspx?CourseID=<%=courseID %>&ClassID=<%=classID %>" target="MainFrame"
                                            onclick="UnShow()">我的课程笔记</a>
                                      </strong>
                                    </td>
                                    <td style="height: 30"  background="ganbu2/nav_bg.gif">
                                        <strong>
                                            <a href="NoteOfSingle.aspx?CourseID=<%=courseID %>&ClassID=<%=classID %>" target="MainFrame"
                                                onclick="UnShow()">我的所有笔记</a>
                                         </strong>
                                    </td>
                                    <td id="td_exam" runat="server" style="height: 30"  background="ganbu2/nav_bg.gif">
                                        <strong>
                                            <a title="在线考试" href="ShowCourseResource.aspx?tid=<%#Eval("RestpID") %>&cid=<%=courseID %>&classid=<%=classID %>&class=2"
                                                target="MainFrame" onclick="UnShow()">在线考试</a>
                                        </strong>
                                    </td>
                                    <td style="height: 30"  background="ganbu2/nav_bg.gif">
                                    <strong>
                                        <a href="Appraise_Course.aspx?type=0&ClassID=<%=classID %>&courseID=<%=courseID %>&tID=<%#Eval("RestpID") %>" target="MainFrame" onclick="UnShow()">课程评价</a>
                                    </strong>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <iframe name="MainFrame" id="MainFrame" src="" width="835" height="590"></iframe>
                        </td>
                    </tr>
                </table>
            </td>
           </tr>
           <tr>
            <td style="vertical-align: top; display: none;" id="Comment" colspan="2" >
                <table border="0" width="100%" style="padding: inherit; border: thin solid #FF9933;">
                    <tr>
                        
                        <td style="vertical-align: top;" align="left">
                            <div>
                                <table width="135" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style=" width: 110px; height: 30" background="ganbu2/nav_bg.gif">
                                        &nbsp;&nbsp;<img src="../../images/set002.JPG" />
                                           <strong>及时研讨</strong>
                                        </td>
                                    </tr>
                                 </table>
                            </div>
                        </td>
                        <td valign="top" align="left">
                            <div>
                                <table width="460" style="padding: inherit; border: thin solid #FFCCCC;">
                                    <tr>
                                        <td>
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0" >
                                                <tr>
                                                    <td class="pl" valign="top">
                                                        <iframe id='R_Evaluation' name='R_Evaluation' frameborder='0'  width='100%'
                                                            height="120" src=''></iframe>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                           </div>
                        </td>
                        <td valign="top" align="left">
                            <table  id="table_Content" name="table_Content" >
                                <tr>
                                    <td>
                                        <table width="390" border="0" cellspacing="0" cellpadding="0" align="center" style="height: 125;padding: inherit; border: thin solid  #FFCCCC;">
                                            <tr>
                                                <td style="padding-left: 3px">
                                                    &nbsp;<textarea id="txt_content" cols="80" name="txt_content" rows="4" style=" width:300"></textarea>&nbsp;
                                                </td>
                                                <td style="padding-right: 3px">
                                                    <input type="button" name="button" id="btn_send" value="提  交" style="border: 0; width: 70px;
                                                        height: 70px; background-color:#C0C0C0" onclick="vaild()" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    </div>
</asp:Content>